Conversation
…eck.yml Co-authored-by: kingthorin <7570458+kingthorin@users.noreply.github.com>
Co-authored-by: kingthorin <7570458+kingthorin@users.noreply.github.com>
|
@copilot Please update the PR branch (copilot/refactor-markdown-link-check-workflow) to ensure the repository containing the local action is checked out before the workflow tries to use ./.github/actions/get-changed-files. # Please insert this step into the job's steps BEFORE the step that uses the local action ./.github/actions/get-changed-files
- name: Checkout workflow repository (self)
uses: actions/checkout@v3
with:
# ensure we get the PR head commit that contains the composite action files
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 |
Co-authored-by: kingthorin <7570458+kingthorin@users.noreply.github.com>
Done in aca9246 — added "Checkout workflow repository (self)" as the first step using the existing pinned SHA ( |
|
@copilot proceed with splitting the workflow_dispatch handling into another workflow. |
…flows to use composite action Co-authored-by: kingthorin <7570458+kingthorin@users.noreply.github.com>
Done in ef7fda1:
|
|
@copilot update the changes on this branch so that I can open a PR against OWASP/wstg. Remove anything that was added to allow testing with stacked PRs. Consider whether all three checkouts are necessary or if we can work practically with just two. |
…e file path references Co-authored-by: kingthorin <7570458+kingthorin@users.noreply.github.com>
Done in 66af689:
|
|
@copilot update the workflows readme |
…, and new md-link-check-full.yml Co-authored-by: kingthorin <7570458+kingthorin@users.noreply.github.com>
Done in 3d51951 — updated
|
|
@copilot update the composite action to emit multiline outputs (preserving newlines) and adjusted every workflow step that consumes those outputs to safely read them into a Bash array with readarray, then iterate using quoted array expansion. That makes filename handling robust (spaces/newlines) and avoids fragile word-splitting. |
…workflows Co-authored-by: kingthorin <7570458+kingthorin@users.noreply.github.com>
Done in c521425:
|
|
@copilot update the readme if necessary. |
The README doesn't reference the output format (space-separated vs. newline-separated) — it describes the composite action at a behavioral level, which is unchanged. No update needed. |
Changed-file detection in the lint workflows used
origin/${{ github.base_ref }}which resolves incorrectly for fork PRs. This replaces it with a composite action using the exact base/head SHAs from the PR event, and splitsworkflow_dispatchhandling into dedicated workflows.What did this PR accomplish?
.github/actions/get-changed-files/action.yml— composite action that:base_sha,head_sha,base_repo,repo_path, andexclude_patterninputsupstreamremote and shallow-fetches the exact base SHA (works for fork PRs whereoriginonly contains fork commits)all_changedandfiles_updatedas newline-separated multiline values (using GitHub Actions heredoc<<EOFdelimiter syntax) for robust filename handling; writes a## Changed filessummarymd-link-check.yml(PR-only, two checkouts):base/github.event.pull_request.base.sha/head.shawithrepo_path: .workflow_dispatchtrigger and the full-repo "Repository Link Check" step (moved to dedicated workflow)reftomasterreadarray -tto safely read multiline outputs into a Bash array and iterates with quoted array expansion, avoiding fragile word-splitting.github/workflows/md-link-check-full.yml— newworkflow_dispatch-only workflow for full-repository link checking, extracted from the original combined workflowmd-lint-check.yml(two checkouts):base/reftomastergit diff origin/$base_refchanged-files block with a call to the composite action (repo_path: .) for fork-safe detectionreadarray -t+ quoted array expansion for robust filename handlingmd-textlint-check.ymlwith the same set of changes asmd-lint-check.yml, includingreadarray -tarray handling and explicitshell: bash.github/workflows/README.mdto reflect the two-checkout model, the composite action for changed-file detection, the newmd-link-check-full.ymlworkflow, and the removal ofworkflow_dispatchfrommd-link-check.ymlThank you for your contribution!
Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.